package com.fdb.efp.cus.api.common;

import java.util.Optional;

public enum YedCompanyClassEnum {
    COMP_CLASS_01("A","A类"),
    COMP_CLASS_02("B","B类"),
    COMP_CLASS_03("C","C类");

    private String type;
    private String desc;
    YedCompanyClassEnum(String type, String desc) {
        this.type=type;
        this.desc=desc;
    }
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
    public static YedCompanyClassEnum getEnum(String type) {
        for (YedCompanyClassEnum setlType : values()) {
            if (setlType.getType().equals(type)) {
                return setlType;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        System.out.println(Optional.ofNullable(YedCompanyClassEnum.getEnum("A")).isPresent());
    }
}
